package com.dlc.yunguang.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.dlc.yunguang.fragment.WashOrderFragment;

/**
 * Created by YoungeTao on 2017/7/13
 * QQ 2276559259.
 * gmail youngetao@gmail.com
 */

public class WashPageAdapter extends FragmentPagerAdapter {

    private final String[] TITLES = {"日","月","年"};

    private Fragment[] fragments = new Fragment[3];
    public WashPageAdapter(FragmentManager fm,int type) {
        super(fm);
        fragments[0] = WashOrderFragment.newInstance(0,type);
        fragments[1] = WashOrderFragment.newInstance(1,type);
        fragments[2] = WashOrderFragment.newInstance(2,type);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TITLES[position];
    }

    @Override
    public int getCount() {
        return TITLES.length;
    }

    @Override
    public Fragment getItem(int position) {
        return  fragments[position];
    }
}
